<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./../css/tongyong.css">
    <link rel="stylesheet" href="./../css/inlandtiao.css">
    <script src="./../js/flexible.js"></script>
    <script src="./../js/aajax.js"></script>
</head>
<body>
    <div id="header">
        <a href="./inlanddiscount.html">
            <h1> &lt; </h1>
        </a>
        <h1>国内折扣</h1>
        <a href="#"><img src="./../assets/images/header_app.png" alt=""></a>
    </div>

    <section id="body">
        <!-- <div class="info">
            <h4 class="title">西域美农新疆特产五星和田红枣250g*2</h4>
            <p class="price">19.8元(5件99元)</p>
            <p class="mall">京东商城|10-22 13:28 chenjin/慢慢买</p>
            <p class="info2"> 原价25.9一斤，凑满5件只要99元价格。 枣子紧实，入口甜爽。适合公司人多的买吧，价格还是不错的。
            </p>
            <img src="http://img10.360buyimg.com/n7/jfs/t1720/256/513904188/195330/ce31e971/55d2cf3eNc2d117d0.jpg" alt="西域美农新疆特产五星和田红枣250g*2  ">
        </div>
        <a href="">前往购买</a>
         <img src="./../assets/images/mmbweixin2.png" alt=""> 
        <div class="tit"> 发表评论</div>
        <div class="reply">
            <div class="form">
                <textarea name="ctl00$ContentBody$txt_nr" id="ctl00_ContentBody_txt_nr" rows="3">
                </textarea> -->
        <!-- <input name="ctl00$ContentBody$lbl_fbr" id="ctl00_ContentBody_lbl_fbr" value="手机端网友58***74" type="hidden">
                <input name="ctl00$ContentBody$hid_name" id="ctl00_ContentBody_hid_name" value="西域美农新疆特产五星和田红枣250g*2" type="hidden"> -->
        <!-- <div class="ctrl">
                    <input name="ctl00$ContentBody$Button1" value="发表评论" id="ctl00_ContentBody_Button1" class="tjdp" type="submit">
                </div>
            </div>
        </div>
        <div class="tit" id="newcomment"> 最新评论</div>
        <div class="list">
            <ul> </ul>
        </div> -->
    </section>
    <div id="footer">
        <ul>
            <li><a href="">登录</a></li>
            <li><a href="">注册</a></li>
            <li><a href="javascript:void(0)" id="goTop">返回顶部</a></li>
        </ul>
        <div class="footer-bottom">
            <div>
                <a href="">手机APP下载</a>
                <span>慢慢买手机版</span>
                <span>&nbsp;-&nbsp;掌上比价平台</span>
                <p>m.manmanbuy.com</p>
                
            </div>
        </div>
    </div>

    
</body>
</html>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
    let val = Number(localStorage.getItem('proId'));


    $.ajax({//请求登录页处理
        url: `http://chst.vip:1234/api/getdiscountproduct?productid=${val}`,
        success: function(res) {//登录成功后返回的数据
            console.log(res);
            let body = document.getElementById("body");
            body.innerHTML = renderProduct(res.result[0]);
        }
    })

function renderProduct(item) {
    let html = `<div class="info">
    <h4 class="title">${item.productName}</h4>
    <p class="price">${item.productPrice}</p>
    <p class="mall">${item.productFrom}|${item.productTime}  ${item.productTips}</p>
    <p class="info2"> ${item.productInfo}
    </p>
    ${item.productImg}
</div>
<a href="">前往购买</a>
<img src="./../assets/images/mmbweixin2.png" alt="">

${item.productComment}`
    return html
}

let goTOP = document.getElementById('goTop');
goTOP.onclick = function() {
    document.documentElement.scrollTop = 0
}

localStorage.removeItem('proId');
</script>